/**
 * 
 */
package com.pnemec.addlog;

import java.io.File;
import java.util.Collection;

import javax.swing.ImageIcon;
import javax.swing.*;
import com.pnemec.swing.*;

/**
 * @author Pavel Nemec
 * @description Interface for Logging module
 * @license GPL v2
 *
 */
public interface LogModule{
	
	/* all_zipped - one big zip for all logs
	 * multiple zip - every module will have own zip
	 * text - put all logs into string buffer !big! 
	 */ 
	public static final int TYPE_ALL_ZIPPED_UPLOAD=10;
	public static final int TYPE_MULTIPLE_ZIPPS=11;
	public static final int TYPE_TEXT_SAVE_AS_FILE=12;
	public static final int TYPE_ZIPP_SAVE_AS_FILE=13;
	
	public String getName();
	/**
	 * Long description, couple of senteces.
	 * @return
	 */
	public String getDescription();
	/**
	 * short description, one line max
	 * @return
	 */
	public String getSummary();
	public Collection getAccesedFiles();
	public JPanel getGui();
	/**
	 * icon  which will represent this module in gui
	 * @return
	 */
	public Icon getIcon();
	public void startGatherLogs();
	public void stopGatherLogs();
	public String getStatus();
	/**
	 * set type of result
	 * @param type - check LogModule.TYPE*
	 */
	public void setType(int type);
	public int getType();
	/**
	 * @return true if gathering is still in progress
	 */
	public boolean isRunning();
	/**
	 * get result as string (quite big!)
	 * @return - String containing all  requested files and output of commands
	 * @throws Exception - when setType was called with different type
	 */
	public String getTextResult() throws Exception;
	/**
	 * return tar file containing all files and output of commands,
	 * this file is registred in DataProvider framework
	 * @return
	 * @throws Exception - when setType was not called with type TYPE_ALL|MULTIPLE_ZIPS
	 */
	public File getTarResult() throws Exception;
}
